package com.smiier.skin.ui;

import android.content.Context;
import android.view.View;
import cn.o.app.ui.ODialog;
import cn.skinapp.R;

public class QuestionLimitDialog {

	protected ODialog mDialog;

	protected QuestionLimitDialogListener mListener;

	public QuestionLimitDialog(Context context) {
		mDialog = new ODialog(context);
		mDialog.setWindowAnimations(R.style.DialogFromTopAnim);
		mDialog.setContentView(R.layout.dialog_question_limit);
		mDialog.findViewById(R.id.qq_btn).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						mDialog.dismiss();
						if (mListener != null) {
							mListener.onInviteQQ();
						}
					}
				});
		mDialog.findViewById(R.id.weixin_btn).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						mDialog.dismiss();
						if (mListener != null) {
							mListener.onInviteWeixin();
						}
					}
				});
		mDialog.findViewById(R.id.contacts_btn).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						mDialog.dismiss();
						if (mListener != null) {
							mListener.onInviteContacts();
						}
					}
				});
		mDialog.findViewById(R.id.know_btn).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						mDialog.dismiss();
					}
				});
	}

	public void show() {
		mDialog.show();
	}

	public void setListener(QuestionLimitDialogListener listener) {
		mListener = listener;
	}

	public static interface QuestionLimitDialogListener {

		public void onInviteWeixin();

		public void onInviteQQ();

		public void onInviteContacts();

	}

}
